#ifndef _IIC_H
#define _IIC_H

#include "stdbool.h"
#include "stm32f4xx.h"
#include "sys.h"
#include "delay.h"


#define SDA_IN()  {GPIOA->MODER&=~(3<<(11*2));GPIOA->MODER|=0<<11*2;}	//PA11????
#define SDA_OUT() {GPIOA->MODER&=~(3<<(11*2));GPIOA->MODER|=1<<11*2;}   //PA11????

#define IIC_SCL    PAout(12) 	
#define IIC_SDA    PAout(11) 		 
#define READ_SDA	PAin(11)

#define IIC_SCL_PIN		GPIO_Pin_12
#define IIC_SDA_PIN		GPIO_Pin_11

void SoftWare_IIC_Init(void);
void IIC_ReadBytes(u8 devaddr,u16 addr,u8 len,u8 *rbuf);
void IIC_WriteBytes(u8 devaddr,u16 addr,u8 len,u8 *wbuf);

#endif
